Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for activityRecognitionPermitted in ActivityRecognitionLocationProvider #198

Merged
merged 2 commits into from
Aug 2, 2024

Conversation

pmlodawski
Copy link

Added check for permissions before calling requestActivityUpdates. Otherwise, when permission is declined I get:

08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: FATAL EXCEPTION: mainjava.lang.SecurityException: Activity detection usage requires the ACTIVITY_RECOGNITION permission
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at android.os.Parcel.createExceptionOrNull(Parcel.java:3183)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at android.os.Parcel.createException(Parcel.java:3167)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at android.os.Parcel.readException(Parcel.java:3150)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at android.os.Parcel.readException(Parcel.java:3092)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.internal.location.zza.zzx(com.google.android.gms:play-services-location@@18.0.0:3)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.internal.location.zzal.zzh(com.google.android.gms:play-services-location@@18.0.0:5)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.internal.location.zzaz.zzq(com.google.android.gms:play-services-location@@18.0.0:4)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.internal.location.zzd.doExecute(com.google.android.gms:play-services-location@@18.0.0:2)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.common.api.internal.BaseImplementation$ApiMethodImpl.run(com.google.android.gms:play-services-base@@18.0.1:1)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.common.api.internal.zaaj.zab(com.google.android.gms:play-services-base@@18.0.1:6)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.common.api.internal.zabi.zaf(com.google.android.gms:play-services-base@@18.0.1:2)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.common.api.internal.zabe.execute(com.google.android.gms:play-services-base@@18.0.1:12)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.internal.location.zzg.requestActivityUpdates(com.google.android.gms:play-services-location@@18.0.0:1)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.marianhello.bgloc.provider.ActivityRecognitionLocationProvider.attachRecorder(ActivityRecognitionLocationProvider.java:160)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.marianhello.bgloc.provider.ActivityRecognitionLocationProvider.onConnected(ActivityRecognitionLocationProvider.java:184)
08-01 15:58:49.895 15460 15460 E com.marianhello.logging.UncaughtExceptionLogger: 	at com.google.android.gms.common.internal.zak.zad(com.google.android.gms:play-services-base@@18.0.1:11)
...

@HarelM HarelM merged commit 2a4c773 into HaylLtd:stable Aug 2, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants